package com.sxmmall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.sxmmall.common.valid.AddGroup;
import com.sxmmall.common.valid.ListValue;
import com.sxmmall.common.valid.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;


/**
 * Ʒ
 * 
 * @author sxm
 * @email 1125400943@qq.com
 * @date 2021-07-06 21:31:03
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * Ʒ
	 */
	@Null(message = "新增品牌id必须为空",groups = AddGroup.class)
	@NotNull(message = "修改必须指定品牌id",groups = UpdateGroup.class)
	@TableId
	private Long brandId;
	/**
	 * Ʒ
	 */
	@NotBlank(message = "品牌名称不能为空",groups = {AddGroup.class,UpdateGroup.class})
	private String name;
	/**
	 * Ʒ
	 */
	@NotEmpty(groups = AddGroup.class)
	@URL(message = "logo 必须是一个合法的地址")
	private String logo;
	/**
	 * 
	 */
	private String descript;
	/**
	 * 
	 */
	@ListValue(message = "状态的值只能是0或者1",vals = {0,1},groups = {AddGroup.class,UpdateGroup.class})
	private Integer showStatus;
	/**
	 * 
	 */
	@NotEmpty
	@Pattern(regexp = "^[a-zA-Z]*",message = "检索首字母必须是一个字母",groups = AddGroup.class)
	private String firstLetter;
	/**
	 * 
	 */
	@NotNull
	@Min(value = 0,message = "排序必须大于等于0")
	private Integer sort;

}
